<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::connection('mysql_log')->create('log_ad_monitor_info', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('点击监控-完整数据');

            $table->increments('id');
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->integer('plan_id')->comment('计划id')->unsigned()->default(0);
            $table->integer('monitor_id')->comment('监控日志id')->unsigned()->default(0);
            $table->mediumText('data')->comment('完整数据')->nullable();

            $table->index('create_time');
            $table->index('plan_id');
            $table->index('monitor_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::connection('mysql_log')->dropIfExists('log_ad_monitor_info');
    }
};
